package com.lagou.tomcat;

import org.apache.catalina.LifecycleException;
import org.apache.catalina.startup.Tomcat;

import javax.servlet.ServletException;

public class SpringBootApplication {
    
    public static void run(){
        Tomcat tomcat = new Tomcat();
        tomcat.setPort(8000);
        try{
            // 要进行一些自动配置，onstart up 就会执行 
            tomcat.addWebapp("/","C:\\");
            tomcat.start();
            tomcat.getServer().await();
        } catch (ServletException e) {
            e.printStackTrace();
        } catch (LifecycleException e) {
            e.printStackTrace();
        }

    }
}
